package com.yunshang.shoppingmall.Methods;

import com.yunshang.shoppingmall.entity.User;
import com.yunshang.shoppingmall.service.UserService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Component;

import javax.annotation.PostConstruct;
import java.util.List;

@Component
public class UserMethods {
    @Autowired
    private UserService userService;
    private static UserService userService1;

    @PostConstruct
    public void init() {
        userService1 = userService;
    }

    public static List<User> getUser() {
        return userService1.selectUserListPhone();
    }

    public static User insert(User user)
    {
        userService1.insertSelective(user);
        return user;
    }

}
